import request from '@/utils/request'

export function fetchAdList(listQuery) {
  return request({
    url: '/ad/list',
    method: 'get',
    params: {
      page:listQuery.page,
      limit: listQuery.limit,
      keywordCount:listQuery.keywordCount,
      title:listQuery.title,
      type:listQuery.type,
      sort:listQuery.sort,
      publishName:listQuery.publishName,
      status:listQuery.status
    }
  })
}

export function fetchAdById(id) {
  return request({
    url: `/ad/${id}`,
    method: 'get',
  })
}


export function createAd(temp) {
  return request({
    url: '/ad/create',
    method: 'post',
    data:temp
  })
}

export function updateAd(temp) {
  return request({
    url: '/ad/update',
    method: 'put',
    data:temp
  })
}
